package tk.model;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Id;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


@Entity
public class Users implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	private int id;
	private String username;
	private String password;
	public Users(){}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	public Users showUser()
	{
/*		ApplicationContext app=new ClassPathXmlApplicationContext("Spring.xml");
		SessionFactory sessionFactory=app.getBean(SessionFactory.class);
		Session session=sessionFactory.openSession();
		//session.beginTransaction();
		Users user=(Users)session.get(this.getClass(), 1);
		return user;*/
		return this;
	}
	
}
